package com.codeczx.intentpassivitydemo;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.LoginFilter;
import android.util.Log;
import android.widget.TextView;

public class PassivityActivity extends AppCompatActivity {

    private TextView textView;
    private static final String TAG = "PassivityActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_passivity);
        textView = (TextView) findViewById(R.id.tv);
        Intent intent = getIntent();
        if(Intent.ACTION_VIEW.equals(intent.getAction())){
            Uri uri = intent.getData();
            Log.i(TAG, "dataString:"+intent.getDataString());
            Log.i(TAG, "scheme:"+uri.getScheme());
            Log.i(TAG, "host:"+uri.getHost());
            Log.i(TAG, "port:"+uri.getPort());
            Log.i(TAG, "path:"+uri.getPath());
            Log.i(TAG, "queryParameter:"+uri.getQueryParameter("id"));
            Log.i(TAG, "query:"+uri.getQuery());
        }
    }
}
